<?xml version="1.0" encoding="ISO-8859-1" ?>

<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Welcome page</title>
  
 <link rel="stylesheet" type="text/css" href="/Fatca_Classification/app1.css"/>
 <link rel="stylesheet" type="text/css" href="/Fatca_Classification/jquery-ui.css"/>
   
<script src="jquery.js"></script>
 <script src="jquery-ui.js"></script>

	<link rel="stylesheet" href="style.css"/>



	<script type="text/javascript">
	 $(function() {
		 
		 var m='${uid}';
		 var sid = '${sid}';
		 var mode='${mode}';
		 var uname= '${uname}';
		 var roleName='${urname}';
		 var suname='${suname}';
		 var classf='${classf}';
		 //alert(m=='');
		 //alert("rolen--"+roleName);
		 if(roleName=='Admin'){
			 $("#tab1").attr("href", "admin");
		 }
		 if(roleName=='Auditor'){
			// alert("auditor");
			 $("#tab1").attr("href", "auditor");
		 }
		 if(roleName=='Maker'){
			 $("#tab1").attr("href", "makerList");
		 }
		 if(roleName=='Maker'){
			 $("#tab1").attr("href", "makerList");
		 }
		 $( "#tabs" ).tabs({
		      beforeLoad: function( event, ui ) {
		        ui.jqXHR.error(function() {
		          ui.panel.html("Loading......");
		        });
		      }
		    });
		 $("#tabs").tabs().css({
			   'min-height': 'auto',
			   'overflow': 'auto'
			});
		 $( "#tabs" ).tabs( "option", "active", 0 );
		 $( "#tabs" ).tabs( "disable", 1 );
		 $( "#tabs" ).tabs( "disable", 2 );
		 $("#tab2").text("");
		 $("#tab3").text("");
		 
		 if(roleName=='Admin'){
			 $( "#tabs" ).tabs( "option", "active", 0 );
			 $( "#tabs" ).tabs( "enable", 1 );
			 $( "#tabs" ).tabs( "disable", 2 );
			 $("#tab1").attr("href", "admin");
			 $("#tab1").text(roleName+" Work List");
			 $("#tab2").attr("href", "adminDoc");
			 $("#tab2").text("Admin Documentation");
			 if(mode=='add'){
				 
				 $("#tab3").attr("href", "adminAddUser");
				 $("#tab3").text("Add User");
				 $( "#tabs" ).tabs( "enable", 2 );
				 $( "#tabs" ).tabs( "option", "active", 2 );
			 }
             if(mode=='edit'){
            	 
				 $("#tab3").attr("href", "adminEditUser?id="+sid);
				 $("#tab3").text("Edit User : "+suname);
				 $( "#tabs" ).tabs( "enable", 2 );
            	 $( "#tabs" ).tabs( "option", "active", 2 );
			 }
		 }
	 
		 if(roleName=='Auditor'){
			 $( "#tabs" ).tabs( "option", "active", 0 );
			 $( "#tabs" ).tabs( "disable", 1 );
			 $("#tab1").attr("href", "auditor");
			 $("#tab1").text(roleName+" Work List");
			 $( "#tabs" ).tabs( "disable", 2 );
			 $("#tab3").text("");
			 
			 if(mode=='edit'){
            	 
				 $("#tab2").attr("href", "editAuditor?id="+sid);
				 var isnffe = '${isnffe}';
				 var statusvc='${status}';
				 if(isnffe=="yes"){
					 $("#tab2").text("NFFE Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusvc);	 
				 }else{
					 $("#tab2").text("FFI Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusvc);
				 }
				 
				 $( "#tabs" ).tabs( "enable", 1 );
            	 $( "#tabs" ).tabs( "option", "active", 1 );
			 }
			 $("#tab2").click(function(){
	    		  location.reload();
	    	  });
		 }
		 
		 
		 if(roleName=='Maker'){
			 
			 $("#tab3").text("");
			 $("#tab1").attr("href", "makerList");
			 $("#tab1").text(roleName+" Work List");
			 
			 
			 if(mode=='add'){
				 
				 $("#tab2").attr("href", "makerAddUser");
				 $("#tab2").text("Add Entity Client");
				 $( "#tabs" ).tabs( "enable", 1 );
				 $( "#tabs" ).tabs(  "option", "active", 1 );
			 }
             if(mode=='individual'){
				 
				 $("#tab2").attr("href", "makerAddUserIndividual");
				 $("#tab2").text("Add Individual Client");
				 $( "#tabs" ).tabs( "enable", 1 );
				 $( "#tabs" ).tabs(  "option", "active", 1 );
			 }
             if(mode=='edit'){
            	 
				 $("#tab2").attr("href", "makerEditUser?id="+sid);
				 $("#tab2").text("Edit User : "+suname+", Case Id : "+sid);
				 $( "#tabs" ).tabs( "enable", 1 );
            	 $( "#tabs" ).tabs( "option", "active", 1 );
			 }
             var cats='${cats}';
             var statusv='${status}';
             var showentity = '${showentity}';
             $("#tab2").click(function(){
	    		  location.reload();
	    	  });
             if(classf=='NFFE'){
            	 
            	 //$("#tab2").attr("href", "makerEditUser?id="+sid);
				 //$("#tab2").text("Edit User : "+suname);
				 
				 if(mode=='showc')$("#tab2").attr("href", "editNffeShow?id="+sid+"&mode=showc&cats="+cats+"&showentity="+showentity);
				 else $("#tab2").attr("href", "editNffeMaker?id="+sid+"&cats="+cats);
				 $("#tab2").text("NFFE Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusv);
				 $( "#tabs" ).tabs( "enable", 1 );
            	 //$( "#tabs" ).tabs( "enable", 2 );
            	 $( "#tabs" ).tabs( "option", "active", 1 );
             }
             if(classf=='FFI'){
            
            	 //$("#tab2").attr("href", "makerEditUser?id="+sid);
				 //$("#tab2").text("Edit User : "+suname);
				 //$("#tab2").attr("href", "editFFI?id="+sid);
				  if(mode=='showc')$("#tab2").attr("href", "editFFIShow?id="+sid+"&mode=showc&cats="+cats);
				 else $("#tab2").attr("href", "editFFIMaker?id="+sid+"&cats="+cats);
				 $("#tab2").text("FFI Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusv);
				 $( "#tabs" ).tabs( "enable", 1 );
            	 //$( "#tabs" ).tabs( "enable", 2 );
            	 $( "#tabs" ).tabs( "option", "active", 1 );
             }
		 }
		 if(roleName=='Checker'){
			 $( "#tabs" ).tabs( "option", "active", 0 );
			 $( "#tabs" ).tabs( "disable", 1 );
			 $("#tab1").attr("href", "makerList");
			 $("#tab1").text(roleName+" Work List");
			 $( "#tabs" ).tabs( "disable", 2 );
			 $("#tab3").text("");
			 
			 if(mode=='edit'){
            	 
				 $("#tab2").attr("href", "editChecker?id="+sid);
				 var isnffe = '${isnffe}';
				 var statusvc='${status}';
				 if(isnffe=="yes"){
					 $("#tab2").text("NFFE Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusvc);	 
				 }else{
					 $("#tab2").text("FFI Screen - User : "+suname+", Case Number : "+sid+", Case Status : "+statusvc);
				 }
				 
				 $( "#tabs" ).tabs( "enable", 1 );
            	 $( "#tabs" ).tabs( "option", "active", 1 );
			 }
			 $("#tab2").click(function(){
	    		  location.reload();
	    	  });
		 }
		 
		 
  	   });
/* 	 
	 tabs.delegate( "span.ui-icon-close", "click", function() {
	      var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" );
	      $( "#" + panelId ).remove();
	      tabs.tabs( "refresh" );
	    }); */
	</script>
	
</head>
    
    <body class="body">
    <div style="height:40px;width:100%;">
   
    <font color="#4078B4" size="6" style="left:20px"> FATCA Classification</font>
  <a style="align:right"> <img src="images/logo.jpg" alt="" align="top" style="position: fixed; right: 10px;"/></a>  
  

  <p align="left" style="padding-top:10px"> <font color="#4078B4" size="2.5px"><b>
User : ${uname} &nbsp; &nbsp;
Role : ${urname}&nbsp; &nbsp;  </b></font>
<a href="<c:url value='/j_spring_security_logout' />" style="float:right" style="padding-top:10px"> <font color="#4078B4" size="2.5px" ><b>Logout    </b> </font>  </a> </p></div>
       
      <div id="content" >
<!-- <div style="height:800px;width:500px;"> -->
<!--<a href="${pageContext.request.contextPath}/index.html">Home page</a><br/></p>-->
<%-- <a href="${pageContext.request.contextPath}/admin.html">Admin</a><br/> --%>
<!--<a href="${pageContext.request.contextPath}/moderation.html">Maker</a><br/>-->
<%-- <a href="${pageContext.request.contextPath}/makerList.html">Maker</a><br/>
<br></br><br></br>  --%>     


<div id="tabs" >
  <ul class="nav-bar">
    <li ><a style="font-size:12px;" href="#" id="tab1"></a></li>
    <li><a href="#" id="tab2"></a></li>
    <li ><a href="#" id="tab3"></a></li>
    
  </ul>
</div>
</div>
<!-- </div> -->
<div class="footer">
<div class="float-left">
<div class="copyright">
&copy; 2014  -  <a href="www.virtusa.com" ><font color="grey"  >  Virtusa Consulting Service.</font></a> All rights reserved.
</div></div>
</div>


</body>
</html>